home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_07_08 / v7n8074a.txt < prev    next >
Text File  |  1989-10-01  |  1KB  |  54 lines

  1.  
  2.  
  3. *****Listing 5*****
  4.  
  5.  
  6.  
  7.      typedef ... table;
  8.      #define TABLE_SIZE 500
  9.      table data_1[TABLE_SIZE] = { ... };
  10.  
  11.      void compute_it(...)
  12.         {
  13.          unsigned short data_1_sum
  14.                = compute_checksum(data_1, sizeof(data_1));
  15.  
  16.          ...
  17.  
  18.          proc_1();
  19.  
  20.          check_checksum("after proc_1: data_1",
  21.                         data_1,sizeof(data_1),
  22.                         data_1_sum);
  23.  
  24.          ...
  25.  
  26.          proc_2();
  27.  
  28.          check_checksum("after proc_2: data_1",
  29.                         data_1,sizeof(data_1),
  30.                         data_1_sum);
  31.  
  32.          /*
  33.             We are going to now modify data_1
  34.             in a way we know is correct
  35.          */
  36.  
  37.          modify_table(data_1,...);
  38.          data_1_sum =
  39.               compute_checksum(data_1, sizeof(data_1));
  40.  
  41.          ...
  42.  
  43.          proc_3();
  44.  
  45.          check_checksum("after proc_3: data_1",
  46.                         data_1,sizeof(data_1),
  47.                         data_1_sum);
  48.  
  49.  
  50.         }
  51.  
  52. **********
  53.  
  54.